package bosc.cn.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.websocket.ContainerProvider;
import javax.websocket.WebSocketContainer;

/**
 * @author tianshq
 * @date 2025/9/6 22:06
 * @description WebSocket客户端配置
 */
@Configuration
public class WebSocketClientConfig {

    @Bean
    public WebSocketContainer webSocketContainer() {
        WebSocketContainer container = ContainerProvider.getWebSocketContainer();
        container.setDefaultMaxSessionIdleTimeout(0); // 永不超时
        return container;
    }
}
